﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace road2.Services
{
    class IntTimeSpanConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var a = ((TimeSpan)value).Milliseconds;
            return a == 0 ? 1000 : a;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return new TimeSpan(0, 0, 0, 0, System.Convert.ToInt32(value));
        }
    }
}
